﻿Public Class Frm_Registre

    Private Sub Frm_Registre_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Partager.Administrat.remplirListCompte()
            Partager.moi.remplir_List_registre()
            For Each khib As Registre In Partager.moi.List_registre
                For Each cmp As Compte In Partager.Administrat.listCompte

                    If khib.Id_Compte = cmp.Id Then
                        List_tous.Items.Add(New ListViewItem(New String() {cmp.nom, khib.date_entree.ToString("HH:mm:ss"), khib.date_sortie.ToString("HH:mm:ss")}))
                    End If
                Next
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub Btn_Rech_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Rech.Click
        Try
            List_tous.Items.Clear()
            For Each khib As Registre In Partager.moi.List_registre
                For Each cmp As Compte In Partager.Administrat.listCompte

                    If khib.Id_Compte = cmp.Id And khib.date_entree >= Date_min.Value And khib.date_entree <= Date_illa.Value Then
                        List_tous.Items.Add(New ListViewItem(New String() {cmp.nom, khib.date_entree.ToString("HH:mm:ss"), khib.date_sortie.ToString("HH:mm:ss")}))
                    End If

                Next
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class